package com.book.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.book.entity.Book;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface BookMapper extends BaseMapper<Book> {
    
    /**
     * 分页查询图书
     */
    IPage<Book> selectBookPage(Page<Book> page, @Param("bookName") String bookName, 
                              @Param("category") String category, @Param("author") String author);
    
    /**
     * 获取图书类别统计
     */
    List<Map<String, Object>> getCategoryStatistics();


    
    /**
     * 获取价格区间统计
     */
    List<Map<String, Object>> getPriceRangeStatistics();
} 